package com.example.demo.bean;

import com.example.demo.annotation.DateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;

/**
 * Created by lyc on 2019/5/31.
 */
@Setter
@Getter
@ToString
public class Dept2 {

    private Integer id;

    @NotBlank(message = "部门名字部门为空")
    private String deptName;

    @Valid
    private List<User> users;

    @DateTime(message = "时间日期格式错误")
    private String createDate;

    @JsonFormat(pattern = "yyyy/MM/dd ", timezone = "GMT+8") // 出参 jackson 日期格式 格式化时间
    @DateTimeFormat(pattern = "yyyy/MM/dd HH:ss") //入参 spring 注解 格式化时间
    private Date updateTime;

    private Integer ids[];
}
